#import "VortexQuirkController.h"
        
#import "VortexQuirkModel.h"
#import "VortexQuirkCell.h"
#import "Masonry.h"

@interface VortexQuirkController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *undertowImaginationTableView;
@property (nonatomic, strong) NSMutableArray *radiateDatas;

@end

@implementation VortexQuirkController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self luminousXeroxConfigsui];
	[self illuminategetData];
}


//: 获取数据模型
- (void)illuminategetData {
	
}

//: 懒加载数据模型数组
- (NSMutableArray *)radiateDatas {
	if (!_radiateDatas) {
		_radiateDatas = [NSMutableArray array];
	}
	return _radiateDatas;
}

- (UITableView *)figHandleTableView {
    if (!_undertowImaginationTableView) {
        _undertowImaginationTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _undertowImaginationTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _undertowImaginationTableView.estimatedRowHeight = 0;
        _undertowImaginationTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _undertowImaginationTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _undertowImaginationTableView.delegate = self;
        _undertowImaginationTableView.dataSource = self;
        _undertowImaginationTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _undertowImaginationTableView.showsVerticalScrollIndicator = NO;
        _undertowImaginationTableView.showsHorizontalScrollIndicator = NO;
        _undertowImaginationTableView.backgroundColor = UIColor.clearColor;
    }
    return _undertowImaginationTableView;
}

//: 初始化页面UI
- (void)luminousXeroxConfigsui {

	[self.view addSubview:self.undertowImaginationTableView];
	[self.undertowImaginationTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.radiateDatas.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    VortexQuirkCell *nostalgia = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([VortexQuirkCell class])];
    if (nostalgia == nil) {
        nostalgia = [[VortexQuirkCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([VortexQuirkCell class])];
    }
    nostalgia.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return nostalgia;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	VortexQuirkModel *hummingbirdNightfallBreeze = self.radiateDatas[indexPath.row];
	return hummingbirdNightfallBreeze.curiosityCellHeight;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
